<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<link href="__VIEW__/css/style1.css" rel="stylesheet" type="text/css" />
		<link href="__VIEW__/css/select.css" rel="stylesheet" type="text/css" />
		<link href="__STATIC__/css/hdjs.css" rel="stylesheet" type="text/css" />
		<script>
			var ajaxCity = "{|U:'ajaxCity'}";
			var ajaxDist = "{|U:'ajaxDist'}";
		</script>
		<script type="text/javascript" src="__STATIC__/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="__STATIC__/js/hdjs.min.js"></script>
		<script type="text/javascript" src="__VIEW__/js/city.js"></script>
		<!--<script type="text/javascript" src="__VIEW__/js/reg.js"></script>-->
		<script type="text/javascript" src="__VIEW__/js/jquery.idTabs.min.js"></script>
		<script type="text/javascript" src="__VIEW__/js/select-ui.min.js"></script>
		<script type="text/javascript" src="__STATIC__/js/cal/lhgcalendar.min.js"></script>
		<script>
			var ajaxCheckUser = "{|U:'checkUserExists'}";
			$(function() {
				var city = '';
				var city1 = '';
				var city2 = '';
				//保存地区的变量 100,200,101
				function ajaxCity() {
					
					$isThis = $(this);
					var cityCode = $(this).val();
					var id = $(this).parent().index();
					if(id==1){
						city1='';
						city2='';
						$(this).parent().next().remove();
					}
					
					if(city1==''){
						city1 = $(this).val();
					}else{
						city2 = $(this).val();
					}
					city = city1+','+city2;
					//写入隐藏表单
					$('input[name=address]').val(city);
					var cityCode = $(this).val();
					//当缓存不存在的时候将去访问ajax得到当前的
					if (id==1) {
						$.ajax({
							url: "{|U:'ajaxCity'}",
							data: {
								'citypid': cityCode
							},
							type: 'post',
							dataType: 'json',
							success: function(phpData) {
								if (phpData.length>0) {
									$.data[cityCode] = phpData;
									var str = '';
									//添加到一个字符串中，省与市使用,逗号分开
									str += '<div class="se">';
									str += '<select class="address" style="opacity: 1; float:left;border:1px solid #A7B5BC;width: 80px;"><option value="">请选择</option>'
									
									$.each(phpData, function(key, val) {
										str += '<option value="' + val.cityid + '">' + val.cityname + '</option>';
									});
									str += '</select>';
									str += '</div>';
									$isThis.parent().after(str);
									$('.address').off();
									$('.address').change(ajaxCity);
								}
							}
						});
					}
				}
				$('.address').change(ajaxCity);
			});
		</script>

		<script type="text/javascript">
			$(document).ready(function(e) {
				$('#birthday').calendar({
					format: 'yyyy/MM/dd HH:mm:ss'
				});
				$(".select1").uedSelect({
					width: 345
				});
				$(".select2").uedSelect({
					width: 167
				});
//				$(".select3").uedSelect({
//					width: 100
//				});
			});
		</script>
	</head>

	<body>

		<div class="place">
			<span>位置：</span>
			<ul class="placeul">
				<li><a href="#">首页</a>
				</li>
				<li><a href="#">用户管理</a>
				</li>
				<li><a href="#">添加用户</a>
				</li>
			</ul>
		</div>

		<div class="formbody">

			<div id="usual1" class="usual">

				<div class="itab">
					<ul>
						<li><a href="#tab1" class="selected">基本信息</a>
						</li>
						<li><a href="#tab2">详细信息</a>
						</li>
					</ul>
				</div>

				<div id="tab1" class="tabson">

					<!--<div class="formtext">Hi，<b>admin</b>，欢迎您试用信息发布功能！</div>-->
					<form action="{|U:'editUser'}" method="post" id="regForm">
					<input type="hidden" value="{$userInfo.uid}" name="uid" />
					<ul class="forminfo">
						<li>
							<label>用户名<b>*</b>
							</label>
							<input name="username" type="text" class="dfinput" value="{$userInfo.username}" placeholder="请填写用户名" style="width:518px;" />
						</li>
						<!--<li>
							<label>密码<b>*</b>
							</label>
							<input name="password" type="password" class="dfinput" placeholder="请填写用户密码" style="width:518px;" />
						</li>-->

						<li>
							<label>用户角色<b>*</b>
							</label>
							<div class="vocation">
								<select class="select1" name="is_admin">
									<option value="0" <if value="$userInfo.is_admin==0">selected="selected"</if>>普通用户</option>
									<option value="1" <if value="$userInfo.is_admin==1">selected="selected"</if>>后台管理员</option>
								</select>
							</div>

						</li>
						<li>
							<label>是否锁定
							</label>
							<div class="vocation">
								<label for="lock">
									<input id="lock" type="radio" value="1" name="is_lock" <if value="$userInfo.is_lock==1" >selected="selected"</if>/>锁定</label>
								<label for="unlock">
									<input id="unlock" type="radio" value="0" name="is_lock" checked="checked" <if value="$userInfo.is_lock==0" >selected="selected"</if> />正常</label>

							</div>

						</li>
						<li>
							<label>&nbsp;</label>
							<input name="" type="submit" class="btn" value="修改" />
						</li>

					</ul>

				</div>

				<div id="tab2" class="tabson">

					<ul class="forminfo">
						<li>
							<label for="truename">真实改名</label>
							<input id="truename" name="truename" type="text" value="{$userInfo.truename}" class="dfinput" placeholder="真实姓名" style="width:518px;" />
						</li>
						<li>
							<label for="bithday">生日</label>
							<input id="birthday" name="birthday" type="text" value="{$userInfo.birthday|hd_date:'Y/m/d H:i:s'}" class="dfinput" placeholder="生日" style="width:518px;" />
						</li>
						<li>
							<label for="telphone">手机</label>
							<input id="telphone" name="telphone" type="text" value="{$userInfo.telphone}" class="dfinput" placeholder="手机号" style="width:518px;" />
						</li>
						<li>
							<label for="user_money">默认金额</label>
							<input id="user_money" name="user_money" type="text" value="{$userInfo.user_money}" class="dfinput" placeholder="默认金额" style="width:518px;" />
						</li>
						<li style="overflow:hidden;margin-bottom:10px;">
							<label for="" style="line-height: 20px;">所在地区</label>
							<div class="se">
								<!--省份选择-->
								<select id="province" style="opacity: 1;border:1px solid cornflowerblue;">
									<option value="0" selected="selected">--请选择/省份--</option>
									<foreach from="$prov" key="$key" value="$val">
										<option value="{$val.provid}" <if value="$val.provid==$addressIds[0]">selected="selected"</if>>{$val.provname}</option>
									</foreach>
								</select>
								<!--城市 -->
								<select style="opacity: 1;border:1px solid cornflowerblue;" name="city" id="city">
									<option value="0" selected="selected">--请选择/市级--</option>
									<foreach from="$citys" key="$key" value="$val">
										<option value="{$val.cityid}" <if value="$val.cityid==$addressIds[1]">selected="selected"</if> >{$val.cityname}</option>
									</foreach>
								</select>
								<!--地区-->
								<select style="opacity: 1;border:1px solid cornflowerblue;" name="dist" id="dist">
									<option value="0" selected="selected">--请选择/县--</option>
									<foreach from="$dists" key="$key" value="$val">
										<option value="{$val.distid}" <if value="$val.distid==$addressIds[2]">selected="selected"</if> >{$val.dist_name}</option>
									</foreach>									
								</select>
								<!--保存所有在地区隐藏表单-->
								<input type="hidden" name="address" value="{$userInfo.address}" />
							</div>
							
						</li>
						<li>
							<label for="alladdress">联系地址</label>
							<!--保存所有在地区隐藏表单-->
							<input type="hidden" name="address" />
							<input id="alladdress" name="alladdress" type="text" value="{$userInfo.alladdress}" class="dfinput" placeholder="联系地址" style="width:518px;" />
						</li>
						<li>
							<label for="zipcode">邮政编码</label>
							<input id="zipcode" name="zipcode" type="text" value="{$userInfo.zipcode}" class="dfinput" placeholder="邮编" style="width:518px;" />
						</li>
						<li>
							<label>&nbsp;</label>
							<input name="" type="submit" class="btn" value="修改" />
						</li>

					</ul>
					</form>
				</div>

			</div>

			<script type="text/javascript">
				$("#usual1 ul").idTabs();
			</script>

			<script type="text/javascript">
				$('.tablelist tbody tr:odd').addClass('odd');
			</script>

		</div>

	</body>

</html>